package cn.tude.ccn.tedu;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import org.w3c.dom.ls.LSOutput;

import java.io.*;

//测试 字节
public class Test4_InputStream {
    public static void main(String[] args) throws IOException {
         method();
         method2();

    }




    public static void method() throws IOException {
        InputStream in=new FileInputStream("E:\\java\txt\123.");
        long start = System.currentTimeMillis();

    //    InputStream in2 =new FileInputStream(new File("E:\\java\\123.txt"));
        //while((in.read())!=-1){ System.out.println(in.read());}

        for (int i = 0; i <in.available() ; i++) {
            System.out.print(in.read());
        }in.close();
        long end = System.currentTimeMillis();
        System.out.println();
        System.out.println(end - start);

    }
    public static void method2() throws IOException {

        InputStream in2=new BufferedInputStream(new FileInputStream("E:\\java\\123.txt"));
        long start =System.currentTimeMillis();
        for (int i = 0; i <in2.available() ; i++) {
            System.out.print(in2.read());
        } in2.close();
        long end=System.currentTimeMillis();
        System.out.println();
        System.out.println(end-start);
    }

}
